﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Data;
using System.ComponentModel;


namespace baseClass.Controls
{
    public class gridProject : common.controls.baseDataGridView 
    {
        public enum ColumnNames
        {
            Code, Description, StartDate
        };

        public gridProject()
        {
        }

        public override void LockEdit(bool lockStat)
        {
            base.LockEdit(true); 
        }
        public override void Init()
        {
            base.Init();
            data.baseDS.emProjectDataTable dummyTbl = new data.baseDS.emProjectDataTable();

            // =============================
            // detailGrid
            // =============================

            // Code
            common.controls.DataGridViewTextBoxColumnExt code = new common.controls.DataGridViewTextBoxColumnExt();
            code.Uppercase = true;
            code.DataPropertyName = dummyTbl.projectCodeColumn.ColumnName;
            code.HeaderText = "Mã số";
            code.Name = ColumnNames.Code.ToString();
            code.Width = 130;

            // onDate
            common.controls.DataGridViewTextBoxColumnExt startDate = new common.controls.DataGridViewTextBoxColumnExt();
            startDate.DataPropertyName = dummyTbl.startDateColumn.ColumnName;
            startDate.HeaderText = "Ngày";
            startDate.Name = ColumnNames.StartDate.ToString();
            startDate.Width = 85;

            // description
            common.controls.DataGridViewTextBoxColumnExt description = new common.controls.DataGridViewTextBoxColumnExt();
            description.DataPropertyName = dummyTbl.descriptionColumn.ColumnName;
            description.HeaderText = "Diễn giải";
            description.Name = ColumnNames.Description.ToString();
            description.Width = 130;

          

            this.Columns.Clear();
            this.Columns.AddRange(new DataGridViewColumn[] { code, startDate, description});

            this.myAutoFitColumn = ColumnNames.Description.ToString();
            this.AutoFit();
        }

    }
}
